<?php
/**
 * Title
 * Created by Jason.
 * User: Administrator
 * Date: 2019/12/7 0007
 * Time: 下午 3:55
 */

namespace app\index\service;


use app\index\interfaces\EBookInterface;

class Kindle implements EBookInterface
{
    /**
     * @var int
     */
    private $page = 2;

    /**
     * @var int
     */
    private $totalPages = 100;

    public function pressNext()
    {
        $this->page++;
    }

    public function unlock()
    {
        $this->page;
    }

    /**
     * 返回当前页和总页数，像 [10, 100] 是总页数100中的第10页。
     *
     * @return int[]
     */
    public function getPage(): array
    {
        return [$this->page, $this->totalPages];
    }
}